package test.core.data;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import com.alibaba.fastjson.JSON;
import hyl.core.conf.MyConfig;
import hyl.core.io.MyFile;
import hyl.core.io.MyPath;


public class MySerialtest {
	@Test
	public void test1() {
		System.out.println(JSON.toJSONString(MyConfig.getConfOfRedis()));
	}

	static user u;

	public static void main(String[] args) {
		u = new user();
		u.name = "小红";
		u.语文 = 98.0;
		u.age = 19;
		u.属性 = new HashMap<>();
		u.属性.put("手机", "12355966969");
		MyPath.test(MyConfig.class);

		String path = MyPath.getPathOfClassLoader(MyConfig.class.getClassLoader()) + "test.serial";
		MySerial.serialize(u, MyFile.openFile(path));
		user u2 = MySerial.deserialize(MyFile.openFile(path));
		System.out.println(u2.name);
		System.out.println(JSON.toJSONString(u2.属性));
	}
}

class user implements Serializable {
	String name;
	Integer age;
	Double 语文;
	Map<String, String> 属性;
}
